package com.scau.hwadee.examination.vo;


import lombok.*;

import java.io.Serializable;

/**
 * @author YHX
 * @date 2019/7/4 13:23
 */
@Getter
@Setter
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class ResponseVo implements Serializable {
    private static final int SUCCESS_CODE = 0;
    private static final String SUCCESS_MESSAGE = "请求成功";
    private int code = SUCCESS_CODE;
    private String message = SUCCESS_MESSAGE;
    private Object data;

    public ResponseVo setMessage(String message) {
        this.message = message;
        return this;
    }

    public ResponseVo(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public ResponseVo setData(Object data) {
        this.data = data;
        return this;
    }

    public static ResponseVo instance() {
        return new ResponseVo();
    }

    public String getMessage() {
        return message;
    }

    public Object getData() {
        return data;
    }
}
